<template>
    <div class="page-header">
        <h2>Vue Router Demo1</h2>
        <button @click="back">后退</button>
        <button @click="forward">前进</button>
        <button @click="testgo">测试一下go</button>
    </div>
</template>
<script>
export default {
    name:'Header',
    methods:{
        back(){
            this.$router.back()
        },
        forward(){
            this.$router.forward();
        },
        testgo(){
            //正数前进，负数后退
            this.$router.go(2);
        }
    }
}
</script>